<?php


/**
 * Notes:
 * PROJECT_NAME : ERP v1.8 重构erp
 * User: 夏鱼儿<397072174@qq.com>
 * Date: 2024/3/14
 * Time: 15:10
 */

namespace app\api\validate;

use think\Validate;

class CartValidate extends Validate
{
    protected $rule = [
        'page'          => 'require',
        "limit"         => "require",
        'id'            => 'require|number',
        'goods_rule_id' => 'require|number',
        'quantity'      => 'require|integer',
    ];

    protected $message = [
        'page.require'          => '页码不能为空',
        'limit.require'         => '每页条数不能为空',
        'id.require'            => 'id不能为空',
        'id.number'             => 'id必须为数字',
        'goods_rule_id.require' => '商品规格id不能为空',
        'goods_rule_id.number'  => '商品规格id必须为数字',
        'quantity.require'      => '数量不能为空',
        'quantity.integer'      => '数量必须为整数',
    ];

    protected $scene = [
        'list' => ['page', 'limit'],
        'add'  => ['goods_rule_id', 'quantity'],
    ];
}